<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        div {
            width: 300px;
            height: 60px;
            border: 3px solid black;
            margin: 30px auto;
            padding: 10px;
            box-sizing: border-box;
        }
    </style>
</head>
<body>
    <div>
        <p>新华网</p>
    </div>
    <div>
        <p>4月21</p>
    </div>
    <div>
        <p>宁夏</p>
    </div>
    <div>
        <p>做好风险</p>
    </div>
</body>
<script>
window.onload = function () {
    var dv = document.getElementsByTagName('div')
    for(var i = 0; i < dv.length; i++) {
        dv[i].onclick = function () {
            var pp = this.getElementsByTagName('p')[0].innerHTML
            alert(pp)
        }
    }
}
</script>
</html>